/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jdbcexemple;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Sergio
 */
public class PruebaLeer {

    public static void main(String[] arg) throws FileNotFoundException, IOException {
        File archivo = null;
        FileReader fr = null;
        BufferedReader br = null;
        String s = "";
        
        Map<Integer, String> linea = new HashMap<Integer, String>();
        
        String s1 = "";

        fr = new FileReader("C:\\Users\\Sergio\\archivo_prueba.txt");

        BufferedReader bf = new BufferedReader(fr);

        int i = 0;
        while ((s = bf.readLine()) != null) {
            linea.put(i, s);
            i++;
        }
        
        for (int j = 0; j < linea.size(); j++) {
            //System.out.println(linea.get(j));
            Dividir(linea.get(j));
        }

    }

    private static void Dividir(String lin) {
        String s[] = lin.split(",");
        
        for (int i = 0; i < s.length; i++) {
            System.out.println(s[i]);
        }
    }
}
